package main

import "fmt"

type set map[int]struct{}

func main() {
	fmt.Println(containsDuplicate([]int{1, 2, 3}))
}

func containsDuplicate(nums []int) bool {
	containSet := make(set, len(nums))
	for _, v := range nums {
		if _, present := containSet[v]; !present {
			containSet[v] = struct{}{}
		} else {
			return true
		}
	}
	return false
}
